<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8" />
<title>服务中心编辑</title>
<meta name="renderer" content="webkit|ie-comp|ie-stand" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport"
	content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<link rel="stylesheet" href="./css/font.css" th:href="@{/css/font.css}" />
<link rel="stylesheet" href="./css/xadmin.css" th:href="@{/css/xadmin.css}" />
<script type="text/javascript" src="/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
<script src="./lib/layui/layui.js" charset="utf-8" th:src="@{/lib/layui/layui.js}"></script>
<script type="text/javascript" src="./js/xadmin.js" th:src="@{/js/xadmin.js}"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=AENediPPZFv16W4XG6Hi3pwLBlld98WE"></script>
 <style>
  #right{width:50%;position: absolute;top: 0;right: 0;}
 </style>
</head>
<body>
	<!-- 顶部开始 -->
	<div class="container">
		<div class="logo">
			<a href="./index.html">运动处方后台管理</a>
		</div>
		<div class="left_open">
			<i title="展开左侧栏" class="iconfont">&#xe699;</i>
		</div>
        <ul class="layui-nav right" lay-filter="">
          <li class="layui-nav-item">
            <a href="javascript:;">admin</a>
            <dl class="layui-nav-child"> <!-- 二级菜单 -->
              <dd><a onclick="x_admin_show('个人信息','http://www.baidu.com')">修改密码</a></dd>
              <dd><a th:href="@{/layout}">退出</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item to-index"><a href="/">前台首页</a></li>
        </ul>
        
    </div>

	<!-- 顶部结束 -->
	<!-- 中部开始 -->
	<!-- 左侧菜单开始 -->
	<div class="left-nav">
		<div id="side-nav">
			<ul id="nav"> 
     <li><a href="javascript:;"> <i class="iconfont"></i> <cite>会员管理</cite> <i class="iconfont nav_right"></i> </a> 
      <ul class="sub-menu"> 
       <li><a th:href="@{/user/getList}"> <i class="iconfont"></i> <cite>会员列表</cite> </a></li> 
      </ul></li> 
     <li><a href="javascript:;"> <i class="iconfont"></i> <cite>健康指南</cite> <i class="iconfont nav_right"></i> </a> 
      <ul class="sub-menu"> 
       <li><a th:href="@{/artType/getList}"> <i class="iconfont"></i> <cite>分类列表</cite> </a></li> 
       <li><a href="javascript:;"> <i class="iconfont"></i> <cite>资讯管理</cite> <i class="iconfont nav_right"></i> </a> 
        <ul class="sub-menu"> 
         <li><a th:href="@{/article/getList}"> <i class="iconfont"></i> <cite>资讯列表</cite> </a></li> 
         <li><a th:href="@{/artType/addArticle}"> <i class="iconfont"></i> <cite>资讯添加</cite> </a></li> 
        </ul></li> 
      </ul></li> 
     <li><a href="javascript:;"> <i class="iconfont"></i> <cite>医师管理</cite> <i class="iconfont nav_right"></i> </a> 
      <ul class="sub-menu"> 
       <li><a th:href="@{/doctorType/query}"> <i class="iconfont"></i> <cite>职业分类列表</cite> </a></li> 
       <li><a th:href="@{/doctor/getList}"> <i class="iconfont"></i> <cite>加入申请列表</cite> </a></li> 
       <li><a th:href="@{/doctor/toAdd}"> <i class="iconfont"></i> <cite>医师增加</cite> </a></li> 
       <li><a th:href="@{/doctor/query}"> <i class="iconfont"></i> <cite>医师列表</cite> </a></li> 
      </ul></li> 
     <li><a href="javascript:;"> <i class="iconfont"></i> <cite>处方管理</cite> <i class="iconfont nav_right"></i> </a> 
      <ul class="sub-menu"> 
       <li><a th:href="@{/illnessType/query}"> <i class="iconfont"></i> <cite>分类列表</cite> </a></li> 
       <li><a href="javascript:;"> <i class="iconfont"></i> <cite>处方管理</cite> <i class="iconfont nav_right"></i> </a> 
        <ul class="sub-menu"> 
         <li><a th:href="@{/recipe/query}"> <i class="iconfont"></i> <cite>处方列表</cite> </a></li> 
         <li><a th:href="@{/recipe/toAdd}"> <i class="iconfont"></i> <cite>处方添加</cite> </a></li> 
        </ul></li> 
      </ul></li> 
     <li><a href="javascript:;"> <i class="iconfont"></i> <cite>服务中心管理</cite> <i class="iconfont nav_right"></i> </a> 
      <ul class="sub-menu"> 
       <li><a th:href="@{/area/query}"> <i class="iconfont"></i> <cite>区域列表</cite> </a></li> 
       <li><a href="javascript:;"> <i class="iconfont"></i> <cite>服务中心管理</cite> <i class="iconfont nav_right"></i> </a> 
        <ul class="sub-menu"> 
         <li><a th:href="@{/serviceCenter/query}"> <i class="iconfont"></i> <cite>服务中心列表</cite> </a></li> 
         <li><a th:href="@{/serviceCenter/toAdd}"> <i class="iconfont"></i> <cite>服务中心添加</cite> </a></li> 
        </ul></li> 
      </ul></li> 
       <li><a href="javascript:;"> <i class="iconfont"></i> <cite>订单管理</cite> <i class="iconfont nav_right"></i> </a> 
      <ul class="sub-menu"> 
       <li><a th:href="@{/order/query}"> <i class="iconfont"></i> <cite>订单列表</cite> </a></li> 
      </ul></li> 
     <li><a href="javascript:;"> <i class="iconfont"></i> <cite>banner图管理</cite> <i class="iconfont nav_right"></i> </a> 
      <ul class="sub-menu"> 
       <li><a th:href="@{/img/query}"> <i class="iconfont"></i> <cite>banner图列表</cite> </a></li> 
       <li><a th:href="@{/img/toAdd}"> <i class="iconfont"></i> <cite>banner图添加</cite> </a></li> 
      </ul> </li> 
     <li><a href="javascript:;"> <i class="iconfont"></i> <cite>保险管理</cite> <i class="iconfont nav_right"></i> </a> 
      <ul class="sub-menu"> 
       <li><a th:href="@{/insurance/query}"> <i class="iconfont"></i> <cite>保险列表</cite> </a></li> 
        <li><a th:href="@{/userreceive/getList}"> <i class="iconfont"></i> <cite>保险领取会员列表</cite> </a></li> 
       <li><a th:href="@{/insurance/toAdd}"> <i class="iconfont"></i> <cite>保险添加</cite> </a></li> 
       <li><a th:href="@{/insuranceDetail/toAdd?type=1}"> <i class="iconfont"></i> <cite>报销说明管理</cite> </a></li>
       <li><a th:href="@{/insuranceDetail/toAdd?type=2}"> <i class="iconfont"></i> <cite>福利说明管理</cite> </a></li>
      </ul> </li> 
       <li><a href="javascript:;"> <i class="iconfont"></i> <cite>区块链管理</cite> <i class="iconfont nav_right"></i> </a> 
      <ul class="sub-menu"> 
       <li><a th:href="@{/chain/toAdd}"> <i class="iconfont"></i> <cite>区块链管理</cite> </a></li> 
      </ul> </li> 
       <li><a href="javascript:;"> <i class="iconfont"></i> <cite>条款管理</cite> <i class="iconfont nav_right"></i> </a> 
      <ul class="sub-menu"> 
         <li><a th:href="@{/insuranceDetail/toAdd?type=3}"> <i class="iconfont"></i> <cite>使用条款管理</cite> </a></li>
       <li><a th:href="@{/insuranceDetail/toAdd?type=4}"> <i class="iconfont"></i> <cite>隐私权政策管理</cite> </a></li>
      </ul> </li> 
    </ul> 
		</div>
	</div>
	<!-- <div class="x-slide_left"></div> -->
	<!-- 左侧菜单结束 -->
	<!-- 右侧主体开始 -->
	<div class="page-content">
		<div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
			<!--  <ul class="layui-tab-title">
            <li>我的桌面</li>
          </ul> -->
          <div class="layui-tab-content" style="margin-top: -30px;">
            <div class="layui-tab-item layui-show" style="overflow: scroll;">
            <p style="color: red;" th:text="${msg}"></p>
                <div class="x-body">
        <form class="layui-form" method="post" enctype="multipart/form-data" th:action="@{/serviceCenter/update}">
        <input type="hidden" id="id" name="id" th:value="${dataMap.serviceCenter.id}"/>
        <input type="hidden" id="id" name="id" th:value="${dataMap.serviceCenter.imgUrl}"/>
        <input type="hidden" id="checkedAreaId" name="checkedAreaId" th:value="${dataMap.serviceCenter.areaId}" />          
          <div class="layui-form-item">
              <label class="layui-form-label">
                  <span class="x-red">*</span>名称
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="name" name="name" required="" th:value="${dataMap.serviceCenter.name}" autocomplete="off" class="layui-input" />
              </div>
          </div>
           <div class="layui-form-item">
              <label class="layui-form-label">
                  <span class="x-red">*</span>所属区域
              </label>
              <div class="layui-input-inline">
                  <select id="areaId" name="areaId">
              			<option th:each="data:${dataMap.areaList}" th:value="${data.id}" th:text="${data.name}"></option>
         	      </select>
              </div>
          </div>
           <div class="layui-form-item">
              <label class="layui-form-label">
                  <span class="x-red">*</span>地址
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="address" name="address" required=""  th:value="${dataMap.serviceCenter.address}"  autocomplete="off" class="layui-input" />
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">
                  <span class="x-red">*</span>经度
              </label>
              <div class="layui-input-inline">
              		<input type="text" id="longitude" name="longitude" required="" th:value="${dataMap.serviceCenter.longitude}"   autocomplete="off" class="layui-input" />
              </div>
              <input class="layui-btn" type="button" onclick="tan()"  value="获取坐标"/>
          </div>
           
          <div class="layui-form-item">
              <label class="layui-form-label">
                  <span class="x-red">*</span>纬度
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="latitude" name="latitude" required="" th:value="${dataMap.serviceCenter.latitude}"   autocomplete="off" class="layui-input" />
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">
                  <span class="x-red">*</span>电话
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="mobile" name="mobile" required="" th:value="${dataMap.serviceCenter.mobile}"   autocomplete="off" class="layui-input" />
              </div>
          </div>
             <div class="layui-form-item">
         <label class="layui-form-label"> <span class="x-red">*</span>健康指导师</label> 
         <div class="layui-input-inline" id="sInstructor">
         		<div class="layui-form-item"  th:each="data:${dataMap.instructorList}" > <input type="text" name="instructor"  th:value="${data.name}"  required=""  autocomplete="off" placeholder="健康指导师姓名"  class="layui-input con_text" />
         		 <input type="text" name="level"  th:value="${data.level}"  required=""  autocomplete="off" placeholder="健康指导师级别" class="layui-input con_text" /> </div>
         </div>
         <i class="layui-icon" style="font-size: 33px; color: green;padding-top: 5px;" th:onclick="'javascript:member_add(this);'">&#xe654;</i> 
         </div> 
             <div class="layui-form-item"> 
         <label class="layui-form-label">缩略图</label> 
         <div class="layui-input-inline"> 
          <input type="file" style="border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px; -o-border-radius:10px;-webkit-border-radius:10px;border:1px solid #ccc;font-size:14pt;padding:5px 10px;" name="file" id="file" /> 
         </div> 
        </div> 
        <div class="layui-form-item"> 
        <div style="max-width:700px;margin:50px"> 
        <label> <span class="x-red">*</span>介绍</label> 
         <textarea id="introduction" name="introduction"  th:text="${dataMap.serviceCenter.introduction}" ></textarea> 
        </div> 
        </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="add" lay-submit="">
                  保存
              </button>
          </div>
      </form>
       <div id="right"><div id="container" style="width: 100%; height: 850px; display: none;" ></div></div>
    </div>
    
<script>
         layui.use('layedit', function(){
       	  var layedit = layui.layedit;
       	 layedit.build('introduction',{
     		  height: 200, //设置编辑器高度
     		  uploadImage: {url: '/article/upload', type: 'post'}
     	  }); //建立编辑器
       	});
         
       	$(function(){
      		// 百度地图API功能
      	  	var map = new BMap.Map("container");            
      	  	map.centerAndZoom(new BMap.Point(116.35, 39.93), 15); 
      	  	map.enableScrollWheelZoom();   //启用滚轮放大缩小，默认禁用
      		map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
      	  	var top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT});// 左上角，添加比例尺
      		var top_left_navigation = new BMap.NavigationControl();  //左上角，添加默认缩放平移控件
      		var top_right_navigation = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL}); //右上角，仅包含平移和缩放按钮
      	/*缩放控件type有四种类型:
      		BMAP_NAVIGATION_CONTROL_SMALL：仅包含平移和缩放按钮；BMAP_NAVIGATION_CONTROL_PAN:仅包含平移按钮；BMAP_NAVIGATION_CONTROL_ZOOM：仅包含缩放按钮*/
    	  	map.addControl(top_left_control);        
    		map.addControl(top_left_navigation);     
    		map.addControl(top_right_navigation);    
      	  	//单击获取点击的经纬度
      	  	map.addEventListener("click",function(e){
      	  		$("#longitude").val(e.point.lng);
      	  		$("#latitude").val(e.point.lat);
      	  	});
      	});
     
      	
      //点击弹出添加国家
        function tan(id){
      	  $("#container").css("display","");
        }
         </script> 
         <script th:inline="javascript">
    /*<![CDATA[*/
		function member_add(obj){
			$("#sInstructor").append('<div class="layui-form-item"><input autocomplete="off" placeholder="健康指导师姓名" class="layui-input con_text"  name="instructors" type="text"/><input type="text" name="levels"  required=""  autocomplete="off" placeholder="健康指导师级别" class="layui-input con_text" /></div>');   
    	}  	
    
      $(function(){
                var checkedAreaId=$("#checkedAreaId").val();
                var areaList = $("#areaId").find("option");
                for (var i = 1; i < areaList.length; i++) {
                    if ($(areaList[i]).val() == checkedAreaId) {
                    	$(areaList[i]).attr("selected", "selected");
                    }
                }
        })
		    	
    /*]]>*/
    </script> 
            </div>
          </div>
        </div>
    </div>
    <div class="page-content-bg"></div>
    <!-- 右侧主体结束 -->
    <!-- 中部结束 -->
    <!-- 底部开始 -->
    <div class="footer">
        <div class="copyright">Copyright ©2017 x-admin v2.3 All Rights Reserved</div>  
    </div>
  
</body>
</html>